//判断是否有滚动条：vertical纵轴，horizontal横轴
function hasScrolled(element, direction) {
  if (direction === "vertical") {
    return element.scrollHeight > element.clientHeight;
  } else if (direction === "horizontal") {
    return element.scrollWidth > element.clientWidth;
  }
}
